//
//  CitiesListCell.m
//  YGYTechnology
//
//  Created by 袁庭楷 on 2018/11/15.
//  Copyright © 2018年 YGY. All rights reserved.
//

#import "CitiesListCell.h"

@implementation CitiesListCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.backgroundColor = [UIColor clearColor];
        [self createUI];
    }
    return self;
}

-(void)createUI{
    UIView *bgView = [UIView new];

    [self.contentView addSubview:bgView];
    [bgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.top.right.bottom.offset(0);
    }];
    
    self.leftLabel = [UILabel new];
    self.leftLabel.textAlignment = NSTextAlignmentLeft;
    self.leftLabel.font = [UIFont systemFontOfSize:14];
    self.leftLabel.textColor = [UIColor blackColor];
    [bgView addSubview:self.leftLabel];
    [self.leftLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(12);
        make.centerY.equalTo(bgView);
    }];
    
    self.iconImage = [UIImageView new];
    self.iconImage.hidden = YES;
    [self.iconImage setImage:[UIImage imageNamed:@"city_selected"]];
    [bgView addSubview:self.iconImage];
    [self.iconImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(self.leftLabel.mas_right).offset(2);
        make.centerY.equalTo(self.leftLabel);
    }];
}


@end
